package Event.lib;

import Creature.Food;
import Creature.Player;
import Event.Story;
import Item.Item;

public class Supermarket extends Story {
    public Supermarket(Player player){
        super(player);

        eventName = "超市购物";
        happenText = "这天晚上你在街上闲逛，看到超市开门，虽然现在的东西都很贵，但你还是决定进去看一下";
        options = new String[]{"什么都不买", "买2包饼干", "要超市收银员的电话","买把水果刀"};
    }

    @Override
    public void eventHappen(int option) {
        switch (option) {
            case 0:
                endText = "你就是饿死也不会给超市赚一分钱！";

                break;
            case 1:
                if(player.getMoney()>=60) {
                endText = "你忍痛买了2包饼干";

                player.foods.add(new Food("饼干"));
                player.foods.add(new Food("饼干"));
                }else {endText = "你钱不够";}
                break;

            case 2:
                endText = "什么都没买还想要别人电话，你被店员拒绝了之后大声说道：30年河东30年河西，莫欺少年穷";
                player.setSan(player.getSan() + 20);
                break;
            case 3:
                endText = "你花了大价钱买了一把水果刀，终于打得过鸡了！";
                player.setPower(player.getPower() + 10);
                break;
        }
    }

    @Override
    public boolean canHappen(Player player) {
        return true;
    }
}
